import request from '@/utils/request'
//企业接口
export const getCompanyListApi = (params) =>
  request.get('/pio-microservice-biz/cbm/organization/company/list')

// 获取配电运行报告列表
export const getElectricRunReportListApi = (params) =>
  request.get(
    '/pio-microservice-biz/pio/ect/report/form/electric/run/report/list',
    { params }
  )

// 删除配电运行报告
export const deleteElectricRunReportApi = (id) =>
  request.post(
    '/pio-microservice-biz/pio/ect/report/form/electric/run/report/delete',
    null,
    {
      params: { id }
    }
  )

// 生成配电运行报告
export const generateElectricRunReportApi = (params) =>
  request.post(
    '/pio-microservice-biz/pio/ect/report/form/electric/run/report/generate',
    null,
    {
      params
    }
  )

// 浏览配电运行报告
export const viewElectricRunReportApi = (id) =>
  request.get(
    '/pio-microservice-biz/pio/ect/report/form/electric/run/report/view',
    {
      params: { id }
    }
  )

// 配电运行报告-下载前预存图表数据
export const saveElectricRunReportPictureApi = (data) =>
  request.post(
    '/pio-microservice-biz/pio/ect/report/form/electric/run/report/savePicture',
    data
  )

// 配电运行报告-下载
export const downloadElectricRunReportApi = (id) =>
  request.post(
    '/pio-microservice-biz/pio/ect/report/form/electric/run/report/download',
    null,
    {
      params: { id },
      responseType: 'blob'
    }
  )
